<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>登陆页面 - 小黄车 后台</title>
		<%@ include file="/common/include/title.jsp"%>
		<script type="text/javascript">
			/* 方法,函数如何定义呢?
				~重新修改img,src的值,强制让浏览器重新从服务器获取一个地址
				
				~先获取img DOM元素;
				~获取img中src的值
			*/
			function refreshImg()
			{
				//alert('----');
				/* 选择器,是模仿着css选择器 
					Jquery就是一个容器,放的是Jquery封装的DOM元素
					选择器:如何将DOM元素放到Jquery容器中呢?Jquery提供了一套和CSS类似的选择器
					
					DOM元素的三要素:标签名,属性,开始节点和结束之间的内容
					获取三要素,修改三要素
				*/
				/* #id,指的是id选择器.
					length:查看容器的大小
					*/
				/* alert($("#imgCode").length); */
				/* 获取img src的值 */
				/* alert($("#imgCode").attr("src")); */
				/* 修改img src的值 
					参数1:属性名
					参数2:属性值
					原来的值和现在的值一样:期望它重新从服务器上获取.
					
					浏览器对相同的url有缓存,所以当url相同的时候,先读缓存的数据,
					只要浏览器的url不相同,是否就可以从服务器上重新获取数据呢?
					如何让url不相同呢????
				*/
				$("#imgCode").attr("src","${rootPath}/CommonServlet?method=randImg&now=" + new Date());
				/* 返回false,表示a链接点击默认的事件阻止 */
				return false ; 
			}
		</script>
	</head>
	<body>
		<%@ include file="/common/include/header.jsp"%>
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1">
				<form id="form" class="form-horizontal" method="post"
					action="${rootPath }/NoLoginServlet?method=adminsLoginSubmit">
					<input type="hidden" name="returnUrl" value="">
	
					<h2 class="col-sm-offset-1 form-signin-heading">登陆</h2>
					<div class="form-group">
						<label for="email" class="col-sm-2 control-label">邮箱</label>
						<div class="col-sm-8">
							<input type="text" id="email" name="email" class="form-control"
								value="${requestScope.email }" placeholder="邮箱">
						</div>
					</div>
					<div class="form-group">
						<label for="inputPassword" class="col-sm-2 control-label">密码</label>
						<div class="col-sm-8">
							<input type="password" name="password" id="inputPassword"
								class="form-control" placeholder="密码" />
						</div>
					</div>
					<div class="form-group">
						<label for="email" class="col-sm-2 control-label">验证码</label>
						<div class="col-sm-8">
							<div class="input-group">
								<span class="input-group-addon"> <a href="#" tabindex="-1"
									onclick="return refreshImg()"> <img id="imgCode"
										src="${rootPath}/CommonServlet?method=randImg" title="点击刷新验证码" width="75" height="20" />
								</a>
								</span> <input type="text" id="code" name="code" class="form-control"
									placeholder="验证码">
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<div class="input-group">
								<div class="checkbox">
									<label> <input type="checkbox" value="remember-me">
										记住我
									</label>
								</div>
								<span class="input-group-addon"> <a href="forgetPass.html">忘记密码</a>
								</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<button class="btn btn-lg btn-primary" type="submit">登陆</button>
							<a href="regsiter.html" class="btn btn-lg btn-primary">注册</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	
		<!-- 提示信息 -->
		<div class="container">
			<div class="col-sm-8 col-sm-offset-1">
				
				<div class="alert alert-warning alert-dismissible fade in"
					role="alert">
					<button type="button" class="close" data-dismiss="alert"
						aria-label="Close">
						<span aria-hidden="true">×</span>
					</button>
					${info }
				</div>
			</div>
		</div>
	
		<%@ include file="/common/include/footer.jsp"%>
	</body>
</html>